package org.glut.AppStoreProject.service;

import org.apache.ibatis.session.SqlSession;
import org.glut.AppStoreProject.entity.AppEntity11;
import org.glut.AppStoreProject.mapper.AppMapper;
import org.glut.AppStoreProject.utils.MybatisUtil;

import java.util.List;

/**
 * 应用服务类，处理应用相关业务逻辑
 */
public class AppService11 {
    public List<AppEntity11> getAppsByAppType(int appType) {
        try (SqlSession session = MybatisUtil.openSession()) {
            AppMapper appMapper = session.getMapper(AppMapper.class);
            return appMapper.getAppsByAppType(appType);
        }catch (Exception e){
            e.printStackTrace(); // 打印完整异常堆栈（关键！）
            throw e; // 重新抛出，确保上层能捕获
        }
    }
}
